package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.InvoiceTitleMapper;
import com.ruoyi.system.domain.InvoiceTitle;
import com.ruoyi.system.service.IInvoiceTitleService;

/**
 * 发票抬头Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-28
 */
@Service
public class InvoiceTitleServiceImpl implements IInvoiceTitleService 
{
    @Autowired
    private InvoiceTitleMapper invoiceTitleMapper;

    /**
     * 查询发票抬头
     * 
     * @param itId 发票抬头ID
     * @return 发票抬头
     */
    @Override
    public InvoiceTitle selectInvoiceTitleById(Long itId)
    {
        return invoiceTitleMapper.selectInvoiceTitleById(itId);
    }

    /**
     * 查询发票抬头列表
     * 
     * @param invoiceTitle 发票抬头
     * @return 发票抬头
     */
    @Override
    public List<InvoiceTitle> selectInvoiceTitleList(InvoiceTitle invoiceTitle)
    {
        return invoiceTitleMapper.selectInvoiceTitleList(invoiceTitle);
    }

    /**
     * 新增发票抬头
     * 
     * @param invoiceTitle 发票抬头
     * @return 结果
     */
    @Override
    public int insertInvoiceTitle(InvoiceTitle invoiceTitle)
    {   invoiceTitle.setCreateTime(DateUtils.getNowDate());
        return invoiceTitleMapper.insertInvoiceTitle(invoiceTitle);
    }

    /**
     * 修改发票抬头
     * 
     * @param invoiceTitle 发票抬头
     * @return 结果
     */
    @Override
    public int updateInvoiceTitle(InvoiceTitle invoiceTitle)
    {   invoiceTitle.setUpdateTime(DateUtils.getNowDate());
        return invoiceTitleMapper.updateInvoiceTitle(invoiceTitle);
    }

    /**
     * 批量删除发票抬头
     * 
     * @param itIds 需要删除的发票抬头ID
     * @return 结果
     */
    @Override
    public int deleteInvoiceTitleByIds(Long[] itIds)
    {
        return invoiceTitleMapper.deleteInvoiceTitleByIds(itIds);
    }

    /**
     * 删除发票抬头信息
     * 
     * @param itId 发票抬头ID
     * @return 结果
     */
    @Override
    public int deleteInvoiceTitleById(Long itId)
    {
        return invoiceTitleMapper.deleteInvoiceTitleById(itId);
    }
}
